<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function add(x) {
        return function (y) {
          return function (z) {
            return x + y + z;
          };
        };
      }

      var a = add(2)(3)(4);
      console.log(a); // 输出 9
    </script>
  </body>
</html>
